package com.example.dw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dw.entity.HomeRund;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 跑马灯Mapper接口
 * @author system
 * @since 2024-01-01
 */
@Mapper
public interface HomeRundMapper extends BaseMapper<HomeRund> {

    /**
     * 获取跑马灯列表（显示的）
     */
    @Select("SELECT hr.*, n.newsName, n.newsContent FROM home_rund hr " +
            "LEFT JOIN news n ON hr.newsid = n.newsid " +
            "WHERE hr.isShow = '1' ORDER BY hr.createdAt DESC")
    List<HomeRund> getRunningText();
} 